package zuoye3;

public class hm3_huiwensushu {
	public static void main(String[] args) {
		for (int a = 0; a <=1000; a++) {
			int i = 0;
			for (i = 2; i <=a; i++) {
				if (a % i == 0) {
					break;
				}
			}
			if(i==a){
				if(i<10){
					System.out.print(i+" ");
				}else if(10<=i && i<100){
					int ge=i%10;
					int shi=i/10;
					if(ge ==shi){
						System.out.print(i+" ");
					}
				}else if(100<=i&& i<1000){
					int ge=i%10;
					int bai=i/100;
					if(ge==bai){
						System.out.print(i+" ");
					}
				}
            }
		}
	}
}